<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return['ischecklogin']=cfc('core')->checklogin('','',true);
$credit_types=credit_types(true);
if($_RQ['op']=='get'){
	$member=$this->get('member',array('mid'=>$_SESSION['uid']));
	$basic=model('core/member')->basic($_SESSION['uid']);
	$member=array_merge($member,$basic);
	$return['member']=$member;
	$return['params']['kuanorderid']=$_RQ['kuanorderid'];
	$this->session('kuanorderid',$_RQ['kuanorderid']);
	$return['kuanorder']=pdo_get('jy_carfee_kuanorder',array('uniacid'=>$_SESSION['uniacid'],'id'=>$_RQ['kuanorderid']));
	if($_RQ['kuanorderid']){
		$return['isno']=$this->count('gonglog',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'kuanorderid'=>$_RQ['kuanorderid']),'id');
	}else{
		$return['isno']=$this->count('gonglog',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'id');
	}
	$return['year']=date('Y');
	$return['month']=date('m');
	$return['ismonth']=$this->get('gonglog',array('month'=>$return['month'],'year'=>$return['year'],'mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid'],'kuanorderid'=>$_RQ['kuanorderid']),'id');
	set_html('title','我的月供');
	exi($return);
}
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $orderby='createtime desc';
	$total='';
	$list=pdo_getslice('jy_carfee_gonglog',$params,array($pindex,$psize),$total,'','','id desc');
	if($list){
		foreach($list as &$item){
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
			$item['statustitle']=$this->gonglog_status[$item['status']];
		}
	}
	$return['list']=$list;
	exi($return);
}
if($_RQ['op']=='tixian'){
	$post=get_postdata();
	$this->update('gonglog',array('status'=>1),array('uniacid'=>$_SESSION['uniacid'],'id'=>$_RQ['id']));
	exi('提交成功！等待审核');
}